home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / COMMON / TOOLS / VB / CABINETS / MSDAO350.CAB / icontrols / DataList / ComboDropDown.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-01-08  |  1.5 KB  |  55 lines

  1. package icontrols.DataList;
  2.  
  3. import com.ms.wd.app.Message;
  4. import com.ms.wd.core.Event;
  5. import com.ms.wd.ui.Control;
  6. import com.ms.wd.ui.CreateParams;
  7.  
  8. class ComboDropDown extends Control {
  9.    Control m_ctl = null;
  10.  
  11.    public ComboDropDown() {
  12.       ((Control)this).setVisible(false);
  13.    }
  14.  
  15.    protected CreateParams getCreateParams() {
  16.       CreateParams cp = super.getCreateParams();
  17.       cp.exStyle |= 8;
  18.       cp.style = -2105540608;
  19.       return cp;
  20.    }
  21.  
  22.    protected void wndProc(Message msg) {
  23.       switch (msg.msg) {
  24.          case 33:
  25.             msg.result = 3;
  26.             break;
  27.          default:
  28.             super.wndProc(msg);
  29.       }
  30.  
  31.    }
  32.  
  33.    public void setComponent(Control ctl) {
  34.       if (this.m_ctl != null) {
  35.          ((Control)this).remove(this.m_ctl);
  36.          this.m_ctl = null;
  37.       }
  38.  
  39.       if (ctl != null) {
  40.          ((Control)this).add(ctl);
  41.          this.m_ctl = ctl;
  42.          this.m_ctl.setBounds(((Control)this).getClientRect());
  43.       }
  44.  
  45.    }
  46.  
  47.    protected void onResize(Event e) {
  48.       if (this.m_ctl != null) {
  49.          this.m_ctl.setBounds(((Control)this).getClientRect());
  50.       }
  51.  
  52.       super.onResize(e);
  53.    }
  54. }
  55.